package com.qwert.shortlink.admin.controller.remote;

import com.qwert.shortlink.admin.common.convention.result.Result;
import com.qwert.shortlink.admin.remote.dto.RedirectLinkRemoteService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author qwert
 * @version 1.0.0
 * @create 2024/7/6 18:27
 **/
@RestController
@RequestMapping("/api/shortlink/admin")
@RequiredArgsConstructor
public class RedirectLinkController {
    RedirectLinkRemoteService redirectLinkRemoteService = new RedirectLinkRemoteService() {
    };

    @RequestMapping("/title")
    public Result<String> getTitleByUrl(@RequestParam("aimUrl") String aimUrl){
        return redirectLinkRemoteService.getTitleByUrl(aimUrl);
    }
}
